package com.ruoyi.sales.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sales.mapper.SalesOrderDetailMapper;
import com.ruoyi.sales.domain.SalesOrderDetail;
import com.ruoyi.sales.service.ISalesOrderDetailService;
import com.ruoyi.common.core.text.Convert;

/**
 * 销售订单明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class SalesOrderDetailServiceImpl implements ISalesOrderDetailService 
{
    @Autowired
    private SalesOrderDetailMapper salesOrderDetailMapper;

    /**
     * 查询销售订单明细
     * 
     * @param detailId 销售订单明细主键
     * @return 销售订单明细
     */
    @Override
    public SalesOrderDetail selectSalesOrderDetailByDetailId(Long detailId)
    {
        return salesOrderDetailMapper.selectSalesOrderDetailByDetailId(detailId);
    }

    /**
     * 查询销售订单明细列表
     * 
     * @param salesOrderDetail 销售订单明细
     * @return 销售订单明细
     */
    @Override
    public List<SalesOrderDetail> selectSalesOrderDetailList(SalesOrderDetail salesOrderDetail)
    {
        return salesOrderDetailMapper.selectSalesOrderDetailList(salesOrderDetail);
    }

    /**
     * 新增销售订单明细
     * 
     * @param salesOrderDetail 销售订单明细
     * @return 结果
     */
    @Override
    public int insertSalesOrderDetail(SalesOrderDetail salesOrderDetail)
    {
        return salesOrderDetailMapper.insertSalesOrderDetail(salesOrderDetail);
    }

    /**
     * 修改销售订单明细
     * 
     * @param salesOrderDetail 销售订单明细
     * @return 结果
     */
    @Override
    public int updateSalesOrderDetail(SalesOrderDetail salesOrderDetail)
    {
        return salesOrderDetailMapper.updateSalesOrderDetail(salesOrderDetail);
    }

    /**
     * 批量删除销售订单明细
     * 
     * @param detailIds 需要删除的销售订单明细主键
     * @return 结果
     */
    @Override
    public int deleteSalesOrderDetailByDetailIds(String detailIds)
    {
        return salesOrderDetailMapper.deleteSalesOrderDetailByDetailIds(Convert.toStrArray(detailIds));
    }

    /**
     * 删除销售订单明细信息
     * 
     * @param detailId 销售订单明细主键
     * @return 结果
     */
    @Override
    public int deleteSalesOrderDetailByDetailId(Long detailId)
    {
        return salesOrderDetailMapper.deleteSalesOrderDetailByDetailId(detailId);
    }
}
